package com.itheima.guava.samples.demo.FactoryDemo;

public class Supplier {

    public static void main(String[] args) {

        //首先找到Nokia工厂
        MobileFactory factory = new NokiaFactory();
        //Nokia工厂开始生产手机
        Mobile mobile = factory.produce();
        System.out.println(mobile.toString());

        //再找到Iphone手机工厂
        factory = new IphoneFactory();
        //Iphone工厂开始生产手机
        mobile = factory.produce();
        System.out.println(mobile.toString());//Iphone：5000.0
    }
}
